import 'package:XinXiZiXun/common/states/theme_color_provider.dart';
import 'package:XinXiZiXun/pages/LoginAndRegister/login_layout.dart';
import 'package:XinXiZiXun/pages/discover/discover.dart';
import 'package:XinXiZiXun/pages/homepage/homepage.dart';
import 'package:XinXiZiXun/pages/mine/mine.dart';
import 'package:XinXiZiXun/pages/mine/systemsetting/system_setting_page.dart';
// import 'package:XinXiZiXun/pages/mine/systemsetting/themecolor.dart';
import 'package:XinXiZiXun/pages/tabbar/tabbar.dart';
import 'package:XinXiZiXun/pages/welcomepage/welcomepage.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MultiProvider(
      providers: [
        ChangeNotifierProvider(create: (context) => ThemeColorProvider()),
      ],
      child: Consumer<ThemeColorProvider>(
        builder: (context, colorProvider, _) => MaterialApp(
          title: '信息咨询',
          theme: ThemeData(
            primarySwatch: colorProvider.color,
            visualDensity: VisualDensity.adaptivePlatformDensity,
            splashColor: Colors.transparent, //去除波纹
            highlightColor: Colors.transparent, //去除高亮
          ),
          debugShowCheckedModeBanner: false,
          routes: {
            '/welcomepage': (context) => WelcomePage(),
            '/tabbar': (context) => ZdyTabBarPage(),
            '/homepage': (context) => HomePage(),
            '/discoverpage': (context) => DiscoverPage(),
            '/minepage': (context) => MinePage(),
            // '/themecolor': (context) => SystemSettingPage(),
            '/loginlayout': (context) => LoginLayoutPage(),
            '/systempage': (context) => SystemSettingPage(),
          },
//      initialRoute: '/welcomepage',
          home: WelcomePage(),
        ),
      ),
    );
  }
}
